package com.honey.mybatis.generator.criteria.field;

import com.honey.compilation.java.Decoration;
import com.honey.compilation.java.Field;
import com.honey.core.types.FullyQualifiedJavaType;
import com.honey.core.types.JDKFullyQualifiedJavaType;
import com.honey.mybatis.generator.AbstractField;
import com.honey.mybatis.generator.criteria.CriteriaConstant;

public class IsNullField extends AbstractField {

	//private static final String FIELD_NAME = CriteriaConstant.IS_NULL_FIELD_NAME;

	private static final FullyQualifiedJavaType TYPE = JDKFullyQualifiedJavaType.getStringInstance();

	private static final String INITIALIZATION = " is null ";

	private static final String[] JAVA_DOC=new String[]{
		"is null 条件。"
	};
	
	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractField#getFieldName()
	 */
	@Override
	protected String getFieldName() {
		return CriteriaConstant.IS_NULL_FIELD_NAME;
	}
	
	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractField#getJavaDoc()
	 */
	@Override
	protected String[] getJavaDoc() {
		return JAVA_DOC;
	}
	
	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractField#getType()
	 */
	@Override
	protected FullyQualifiedJavaType getType() {
		return TYPE;
	}

	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractField#getInitialization()
	 */
	@Override
	protected String getInitialization() {
		return INITIALIZATION;
	}

	
	
	@Override
	protected Decoration getDecoration() {
		Decoration answer = super.getDecoration();
		answer.setFinal(true);
		answer.setStatic(true);
		
		return answer;
	}

	public static void main(String []args){
		IsNullField f = new IsNullField();
		Field field =  f.createField() ;
		System.out.println(field.compiledContent(1));
	}
}
